﻿/**************************************************
* Classe ModeleParcoursEvent                         *
* événements générés par le modele du parcours *
**************************************************/

package utils.appli.events {
	
	import flash.events.Event;
	
	public class ModelePlateauEvent extends Event {
		
		/***************
		*les constantes*
		***************/
		
		public static const RESET:String = "reset";
		public static const CASE_OCCUPEE:String = "case occupée";
		public static const CASE_VIDEE:String = "case vidée";
		
		/****************************
		*les propriétés d'occurrence*
		****************************/
		
		private var _numCase:int;

		/****************
		*le constructeur*
		****************/
		
		public function ModelePlateauEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, numCase:int = -1) {
			//initialisation du constructeur de la classe Event
			super(type, bubbles, cancelable);
			if(numCase==-1) {
				this._numCase = -1;
			}
			else{
				this._numCase = numCase;
			}
		}
		
		/***************
		*les méthodes*
		***************/
		
		//surcharge de la méthode clone (obligatoire)
		public override function clone():Event {
			return new ModelePlateauEvent(type, bubbles, cancelable);
		}
		
		//surcharge de la méthode toString (obligatoire)
		public override function toString():String {
			return("[ModelePlateauEvent type : "+type+", bubbles : "+bubbles+", cancelable : "+cancelable+"]");
		}
		
		/***********************
		*les getters et setters*
		***********************/
		
		public function get numCase():int {
			return this._numCase;
		}
		
		public function set numCase(numCase:int):void {
			this._numCase = numCase;
		}
	}
}